import Vue from 'vue'

import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
		//公共的变量，这里的变量不能随便修改，只能通过触发mutations的方法才能改变
		// 规格列表
		spec:[],
		// 选中购物车列表
		checkcarlist:[],
		
		//关于项目信息
		messageList:[
			{id:"1",name:"葫芦娃",title:"标题名称内容",titleTag:"招商信息",
			message:"dddddddsadagenwoihi各位hi哦个黑哦我会给oh我国i哦好各位各五个五个五个共分五个五个二杠五个ddddd",
			date:"12-24 18:45",
			letter:[
				{id:"1",name:"孙悟空",
				message:"你的项目我很感兴趣",
				date:"12-24 18:58",
				restore:[
					{
						id:"1",
						message:"好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀好呀"
					},
					{
						id:"2",
						message:"好呀"
					}
				]}
			]
			},
			{id:"2",name:"唐僧",title:"标题名称内容",titleTag:"地方项目",
			message:"dddddd股价跌我会给oh股价跌我会给oh股价跌我会给oh股价跌我会给oh股价跌我会给oh股价跌我会给oh股价跌我会给oh股价跌我会给oh我ddddd",
			date:"01-02 15:25",
			letter:[
				{id:"1",name:"孙悟空",
				message:"你的项目我很感兴趣",
				date:"01-02 15:30",
				restore:[
					{
						id:"1",
						message:"好呀"
					}
				]},
				{id:"2",name:"葫芦娃",
				message:"你的项目我很感兴趣",
				date:"01-02 17:58",
				restore:[
					{
						id:"1",
						message:"好呀"
					}
				]}
			]}
		],
	},
    mutations: {
		//相当于同步的操作
		setspec(state,arr){
			state.spec=arr
		},
		setcheckcarlist(state,arr){
			state.checkcarlist=arr
		}
	},
    actions: {
		//相当于异步的操作,不能直接改变state的值，只能通过触发mutations的方法才能改变
	}
})
export default store
